package com.sky.mapper;

import com.sky.entity.Dish;
import com.sky.entity.OrderDetail;
import com.sky.entity.Orders;
import com.sky.entity.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrderDetailsMapper {

    public void insertBatch(List<OrderDetail> orderDetails);

    @Select("select * from order_detail where order_id = #{id}")
    List<OrderDetail> getByOrderId(Long id);

    @Select("select s.name from order_detail od,setmeal s where s.id = #{od.setmealId}")
    Setmeal getSetmeal(OrderDetail orderDetail);

    @Select("select d.name from order_detail od,dish d where d.id = #{od.dishId}")
    Dish getDish(OrderDetail orderDetail);
}
